package com.jshoperxms.service.impl;

import com.jshoperxms.controller.utils.statickey.SerialKeys;
import com.jshoperxms.controller.utils.statickey.TagWords;
import com.jshoperxms.dao.TopicArticleTDao;
import com.jshoperxms.entity.TopicArticleT;
import com.jshoperxms.service.TopicArticleTService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by sdywcd on 16/11/22.
 * Des:
 */
@Service("topicArticleTService")
@Scope("prototype")
public class TopicArticleTServiceImpl extends BaseTServiceImpl<TopicArticleT> implements TopicArticleTService {


    @Resource
    private TopicArticleTDao topicArticleTDao;


    @Resource
    private Serial serial;



    @Transactional(propagation= Propagation.REQUIRED)
    @Override
    public void saveTopicArticleTransactional(TopicArticleT rq) {
        //1,保存话题文章
        TopicArticleT bean=new TopicArticleT();
        bean.setId(this.serial.Serialid(SerialKeys.TOPICT));
        String[] ids= StringUtils.split(rq.getTopiclabels(), TagWords.SPLITDOT);
        for(String s:ids){

        }
    }
}
